package com.example.sky.service.impl;

import com.example.sky.dao.HelloMapper;
import com.example.sky.entity.Hello;
import com.example.sky.service.HelloService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
public class HelloServiceImpl implements HelloService {

    @Autowired
    private HelloMapper helloMapper;

    @Override
    public List<Hello> findAll() {
        return helloMapper.findAll();
    }

    @Override
    public List<Hello> findByPage(int pageNo,int pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        return helloMapper.findByPage();
    }
}
